#include "../include/geometryRhombus.hpp"
#include <stdexcept>

namespace geometry {

Rhombus::Rhombus(double diagonal1, double diagonal2) : diagonal1_(diagonal1), diagonal2_(diagonal2) {
    if (diagonal1_ <= 0 || diagonal2_ <= 0) {
        throw std::invalid_argument("Diagonals must be positive.");
    }
}

double Rhombus::getArea() const {
    return (diagonal1_ * diagonal2_) / 2.0;
}

} // namespace geometry